// components/authorization/authorization.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
      isLogin:true
  },

  /**
   * 组件的方法列表
   */
  methods: {
    
  },
  lifetimes:{
    attached(){
      const app = getApp()
      this.setData({isLogin:!!app.token})
      const pages = getCurrentPages()
      const currect = pages[pages.length - 1]
      console.log(currect);
      if(!app.token){
        wx.navigateTo({url:'/pages/login/index?redirect=' + currect.route})
      }
    }
  }
})
